asterisk-15.x: remove build timestamp
authorAlexander Couzens <[email protected]>
Wed, 6 Dec 2017 01:04:39 +0000 (02:04 +0100)
committerAlexander Couzens <[email protected]>
Wed, 6 Dec 2017 20:27:24 +0000 (21:27 +0100)
Build timestamps prevent reproducible builds [0].
Thanks to debian for the patch

[0] https://reproducible-builds.org/docs/timestamps/

Signed-off-by: Alexander Couzens <[email protected]>
net/asterisk-15.x/Makefile
net/asterisk-15.x/patches/100-build-reproducibly.patch [new file with mode: 0644]

index 83afba0e89cd2409983dbe51afa75d66d4aebc91..12c261cf6b4776fe5a999ae772525a85a62f1a67 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk15
 PKG_VERSION:=15.1.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=asterisk-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://downloads.asterisk.org/pub/telephony/asterisk/releases
diff --git a/net/asterisk-15.x/patches/100-build-reproducibly.patch b/net/asterisk-15.x/patches/100-build-reproducibly.patch
new file mode 100644 (file)
index 0000000..23e1f01
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/build_tools/make_build_h
++++ b/build_tools/make_build_h
+@@ -5,6 +5,14 @@
+ OS=`uname -s`
+ USER=`id | awk -F")" '{print $1}'| awk -F"(" '{print $2}' | sed 's/\\\\/\\\\\\\\/g'`
+ DATE=`date -u "+%Y-%m-%d %H:%M:%S"`
++if [ -n "${SOURCE_DATE_EPOCH}" ]; then
++      # building reproducibly, faking some data
++      HOSTNAME='buildd.debian.org'
++      KERNEL='unknown'
++      MACHINE='unknown'
++      USER='nobody'
++      DATE=`date -u "+%Y-%m-%d %H:%M:%S" -d @${SOURCE_DATE_EPOCH}`
++fi
+ cat << END
+ /*
+  * build.h
+--- a/Makefile
++++ b/Makefile
+@@ -465,7 +465,7 @@
+       @echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
+       @for x in $(MOD_SUBDIRS); do \
+               printf "$$x " ; \
+-              for i in `find $$x -name '*.c'`; do \
++              for i in `find $$x -name '*.c' | LC_ALL=C sort`; do \
+                       $(AWK) -f build_tools/get_documentation $$i >> $@ ; \
+               done ; \
+       done